// JavaScript source code
function setSizeRadWindow() {
    var radWindow = arguments[0];
	if(radWindow == null || radWindow.isClosed)
	{
		return;
	}
    for (var i = 1; i < (arguments.length + 1) / 2; i++) {
        if (window.innerWidth > arguments[2 * i - 1]) {
            radWindow.set_width(arguments[2 * i - 1]);
            if (window.innerHeight > arguments[2 * i]) {
                radWindow.set_height(arguments[2 * i]);
            }
            else {
                radWindow.set_height(window.innerHeight);
            }
            win0.center();
            return;
        }
    }
    radWindow.set_width(window.innerWidth);
    if (window.innerHeight > arguments[arguments.length - 1]) {
        radWindow.set_height(arguments[arguments.length - 1]);
    }
    else {
        radWindow.set_height(window.innerHeight);
    }
    win0.center();
}

function AutoFixSizeGrid(grid, height_banner, offset) {
    var h_screen = window.innerHeight;
    var h_banner = height_banner;
    var htemp = h_screen - h_banner;
    var masterTableHeader = grid.get_masterTableViewHeader().get_element();
    var masterTable = grid.get_masterTableView().get_element();

    masterTable.parentNode.style.height = htemp + offset;
    grid._scrolling.initializeAutoLayout();
    grid.repaint();
    grid.get_masterTableView().selectItem(0);
}